home *** CD-ROM | disk | FTP | other *** search
/ Internet Publisher's Toolbox 2.0 / Internet Publisher's Toolbox.iso / internet / ntserver / wtsource / irtfiles.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-16  |  5.3 KB  |  143 lines

  1.  
  2. /* Copyright (c) CNIDR (Work in progress) */
  3.  
  4. /* WIDE AREA INFORMATION SERVER SOFTWARE:
  5.    No guarantees or restrictions.  See the readme file for the full standard
  6.    disclaimer.
  7.  
  8.    Brewster@think.com
  9. */
  10.  
  11. /* header for irtfiles.c */
  12.  
  13. #ifndef IRTFILES_H
  14. #define IRTFILES_H
  15.  
  16. #include "cdialect.h"
  17. #include "irfiles.h" /* for database struct */
  18.  
  19. #ifdef __cplusplus
  20. /* declare these as C style functions */
  21. extern "C"
  22.     {
  23. #endif /* def __cplusplus */
  24.  
  25. #define kWordBreakNonAlnum  0
  26. #define kWordBreakSpace         1
  27.  
  28. typedef boolean (boolfunc)();
  29. typedef void (voidfunc)();
  30. typedef long (longfunc)();
  31.  
  32. char *make_joint_word _AP((char *word1, char *word2));
  33.  
  34. /* multitype extensions */
  35. typedef struct {        /* dgg, use this instead of a dozen parameters in several funcs */
  36.                 boolean (*separator_function)();
  37.                 void (*header_function)();
  38.                 long (*date_function)();
  39.                 void (*finish_header_function)(); 
  40.                 boolean (*wordDelimiter)();     /* ? use global wordDelimiter ? */
  41.                 char *type;                     /* TEXT, PICT, ... */
  42.                 char *indextype;                 /* SOUNDEX, PHONIX */
  43.                 char *multitype;                /* TEXT, PICT, ... */
  44.                 boolean addseparatorwords;      /* add words in line separating documents */
  45.                 boolean extraheaderweight;      /* add header weight */
  46.                 int repeat_weight;              /* 0 for max of 1 word hit per doc */
  47.                 int minwordlen;                 /* 2= default, 1=symbols */
  48.                 char *delimiters;
  49.                 } dataopsrec, *dataopsptr;
  50.  
  51. boolean (*wordDelimiter)();   /* global word break func, dgg */
  52.  
  53.  
  54. #ifdef SOUND
  55. typedef long (wordfunc) _AP((char *word, long char_pos,
  56.                              long line_pos, long weight,
  57.                              long doc_id, time_t date,
  58.                              boolean capitalized, database* db,
  59.                              boolean word_position, boolean word_pairs));
  60.  
  61. long map_over_words
  62.   _AP((char* line,long document_id,long weight,long file_position_before_line,
  63.        long* line_length,boolean* newline_terminated,database* db,
  64.        wordfunc wordfunction, boolean word_position, boolean word_pairs,
  65.                          int minwordlen, char* type));
  66. #else
  67. typedef long (wordfunc) _AP((char *word, long char_pos,
  68.                  long line_pos, long weight,
  69.                  long doc_id, time_t date,
  70.                  boolean capitalized, database* db,
  71.                  boolean word_position, boolean word_pairs));
  72.  
  73. long map_over_words
  74.   _AP((char* line,long document_id,long weight,long file_position_before_line,
  75.        long* line_length,boolean* newline_terminated,database* db,
  76.        wordfunc wordfunction, boolean word_position, boolean word_pairs,
  77.              int minwordlen));
  78. #endif
  79.  
  80. void index_text_file _AP((char* filename,
  81.                           dataopsrec* dataops,
  82.                           database* db,
  83.                           boolean check_for_text_file,
  84.                           boolean check_for_file_already_indexed,
  85.                           boolean word_position, boolean word_pairs,
  86.                           FILE* filter_process_in, FILE*filter_process_out));
  87.  
  88. /* void index_text_file _AP((char* filename,
  89.               boolean (*separator_function)(),
  90.               void (*header_function)(),
  91.               longfunc *date_function,
  92.               void (*put_together_header_function)(), 
  93.               char *type,
  94.               database* db,
  95.               boolean check_for_text_file,
  96.               boolean check_for_file_already_indexed,
  97.               boolean word_position, boolean word_pairs,
  98.                 int minwordlen));  */
  99.  
  100. boolean directoryp _AP ((char *file));
  101.  
  102. boolean filep _AP((char* file));
  103.  
  104. #ifdef WIN32
  105. #define EXCLUDEFILENAMESLEN 1024
  106. void index_directory _AP ((char *file,
  107.                dataopsrec* dataops,           
  108.                database *db,
  109.                boolean check_for_text_file,
  110.                boolean check_for_file_already_indexed,
  111.                boolean word_position, boolean word_pairs, char *filemask,
  112.                FILE* filter_process_in, FILE*filter_process_out));
  113. #else
  114. void index_directory _AP ((char *file,
  115.                            dataopsrec* dataops,                   
  116.                            database *db,
  117.                            boolean check_for_text_file,
  118.                            boolean check_for_file_already_indexed,
  119.                            boolean word_position, boolean word_pairs,
  120.                            FILE* filter_process_in, FILE*filter_process_out));
  121. #endif
  122.  
  123. /* void index_directory _AP ((char *file,
  124.                boolfunc *separator_function,
  125.                voidfunc *header_function,
  126.                longfunc *date_function,
  127.                voidfunc *finish_header_function, 
  128.                char *type,
  129.                database *db,
  130.                boolean check_for_text_file,
  131.                boolean check_for_file_already_indexed,
  132.                boolean word_position, boolean word_pairs,
  133.                 int minwordlen)); */
  134.  
  135. char *cleanHeadline _AP((char* headline));
  136.  
  137.  
  138. #ifdef __cplusplus
  139.     }
  140. #endif /* def __cplusplus */
  141. #endif /* ndef IRTFILES_H */
  142.  
  143.